package two_xia.ex2.three02;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        while (true) {
            System.out.println("以此输入账号和密码");
            Scanner scanner = new Scanner(System.in);
            //先后输入账号和密码,获得你输入的用户的权限，或者没有权限：-1
            int permission = UserDAO.findPermission(scanner.next(), scanner.next());
            //System.out.println(permission);  测试用
            User user = UserFactory.getUser(permission);
            //System.out.println(user);   测试用
            if (user != null) {
                user.diffOperation();
            }
        }

    }
}
